// 认证相关类型定义

// 用户角色枚举
export enum UserRole {
  USER = 'USER',
  ADMIN = 'ADMIN',
  SUPERADMIN = 'SUPERADMIN'
}

// 验证码用途枚举
export enum VerificationPurpose {
  EMAIL_VERIFICATION = 'email_verification',
  PASSWORD_RESET = 'password_reset'
}

// 基础用户信息
export interface User {
  id: number;
  username: string;
  email: string;
  avatar: string;
  bio: string;
  role: UserRole;
  isActive: boolean;
  createdAt: string;
  updatedAt: string;
}

// 公开用户信息（其他用户查看时返回）
export interface PublicUser {
  id: number;
  username: string;
  avatar: string;
  bio: string;
  role: UserRole;
}

// 发送验证码请求
export interface SendVerificationCodeRequest {
  email: string;
  purpose: VerificationPurpose;
}

// 用户注册请求
export interface RegisterRequest {
  username: string;
  email: string;
  password: string;
  verificationCode: string;
  bio?: string;
}

// 管理员注册请求
export interface RegisterAdminRequest {
  username: string;
  email: string;
  password: string;
  verificationCode: string;
  bio?: string;
}

// 用户登录请求
export interface LoginRequest {
  account: string; // 用户名或邮箱
  password: string;
}

// 登录响应
export interface LoginResponse {
  token: string;
  user: User;
}

// 重置密码请求
export interface ResetPasswordRequest {
  email: string;
  verificationCode: string;
  newPassword: string;
}

// 修改密码请求
export interface ChangePasswordRequest {
  oldPassword: string;
  newPassword: string;
}

// 审核管理员申请请求
export interface ReviewAdminApplicationRequest {
  approved: boolean;
  rejectReason?: string;
}

// API响应基础类型
export interface ApiResponse<T = any> {
  code: number;
  message: string;
  data: T;
} 